tools: libxc: restore: copy the correct page to memory
authorHong Tao <bobby.hong@huawei.com>
Mon, 22 Sep 2014 05:59:13 +0000 (13:59 +0800)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 22 Sep 2014 14:18:15 +0000 (15:18 +0100)
commit035a72faf29eb691542f3fdb7cb347b323c72800
tree3f1649624a76f26227237c41a20fb9124afcdd78
parentd198fbe6cfe6feaa85259da984a221d841f8355a
tools: libxc: restore: copy the correct page to memory

apply_batch() only handles MAX_BATCH_SIZE pages at one time. If
there is some bogus/unmapped/allocate-only/broken page, we will
skip it. So when we call apply_batch() again, the first page's
index is curbatch - invalid_pages. invalid_pages stores the number
of bogus/unmapped/allocate-only/broken pages we have found.

In many cases, invalid_pages is 0, so we don't catch this error.

Signed-off-by: Hong Tao <bobby.hong@huawei.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_domain_restore.c